#ifndef __BATTERY_CHECK_H__
#define __BATTERY_CHECK_H__
#include <stdio.h>
#include <mbed.h>
class BatteryCheck
{
public:
    static BatteryCheck &Instance();
    class IOnEvent
	{
	public:
		virtual int on_power(int nVal)=0;
		virtual int on_lowpower(int nVal)=0;
	};
    void Init();
    void Start();
    void Stop();
    void SetEventListener(IOnEvent* _pEvent);
    ~BatteryCheck();
	int GetBatVal();
private:
    BatteryCheck();
    void RunCheck();
private:
    static BatteryCheck mInstance; 
    rtos::RtosTimer rtBtCheckTimer;
    IOnEvent *pEvent;
    bool bIsInit;
	int nLowPowerCount;
};

#endif